﻿#pragma once

#include <poco/Util/ServerApplication.h>
#include <poco/Util/Option.h>
#include <poco/Util/OptionSet.h>

//参考：https://blog.csdn.net/u013279723/article/details/104782660

class CMyServerApplication :public Poco::Util::ServerApplication
{
public:
	CMyServerApplication();

	~CMyServerApplication();

public://重写基类函数
	/**
	 * @brief 系统资源初始化
	 * @param self
	*/
	void initialize(Application& self);

	/**
	 * @brief 系统资源释放
	*/
	void uninitialize();

	/**
	 * @brief
	 * @param options
	*/
	void defineOptions(Poco::Util::OptionSet& options);

	/**
	 * @brief
	 * @param name
	 * @param value
	*/
	void handleOption(const std::string& name, const std::string& value);

	/**
	 * @brief 业务内容
	 * @param args
	 * @return
	*/
	int main(const std::vector<std::string>& args);
};

